#include <iostream>
#include <fstream>
#include <cstring>

#define SIZE 46

using namespace std;

void write_series_to_file(string, int, int, double*);

int main(int argc, char const *argv[])
{
	double signal[] = {0,0,0,0,-0.0638562,0,0,0.178843,0.238059,0.0849162,0,0,0.718661,0,0.765489,0.84725,0.855416,0.859929,0.758382,0.638251,0.588424,0.610049,0.411795,0.334176,0.0619006,0.217314,0.290503,0.24842,0.242165,0.82325,0.828788,0.778606,0,0.874737,0.319498,0.726019,0.521165,0.670241,0.426637,0.335626,0.317056,0.295632,0,0.274818,0.227473,0};
	int line = 2300; int sample = 2300;
	write_series_to_file("output.txt", line, sample, signal);
	write_series_to_file("output.txt", line, sample, signal);
	write_series_to_file("output.txt", line, sample, signal);
	write_series_to_file("output.txt", line, sample, signal);
	write_series_to_file("output.txt", line, sample, signal);
	return 0;
}

void write_series_to_file(string file, int line, int sample, double *series)
{
	char filename[20];
	strcpy(filename, file.c_str());
	ofstream ofs;
	ofs.open(filename, ios::app);
	ofs << line << "\t" << sample << "\t";
	for (int i = 0; i < SIZE; ++i)
		ofs << series[i] << "\t";
	ofs << endl;
	ofs.close();
}